const { program } = require('commander')
// program
//   .description('I need to help!')
// console.log(123);
// const addFormat = (value, Accumulator) => {
//   console.log(value, Accumulator);
//   return value;
// };
// program
// .description('I need to help!')
// .option('-a,--add <arg1>','add something', addFormat)
// .option('-s,--sum <arg2>','sum something', addFormat)
// .parse(process.argv);
// const options = program.opts()
// console.log(options)

// const addFormat = (value, Accumulator) => {
//   console.log(value, Accumulator);
//   return value;
// };

// program
//   .description(`None example Delete traffic data within a specified period. 
//                 -e.g. node scripts/delete-stats-bucket-single.js -o "2021-07-25 00:00:00" -w "2021-07-25 00:00:00"`)
//   .option('-o, --one <pubtime1>', 'pubtime1', addFormat)
//   .option('-t, --two <pubtime2>', 'pubtime2', addFormat)
//   .action((t) => {
//     console.log('child1 action call');
//   });
// // 选项则使用.opts()来获取选项值
// const options = program.opts();
// console.log(options);

const addFormat = (value, Accumulator) => {
  console.log(value, Accumulator);
  return value;
};

program
  .description(`None example Delete traffic data within a specified period. 
                -e.g. node scripts/delete-stats-bucket-single.js -o "2021-07-25 00:00:00" -w "2021-07-25 00:00:00"`)
  .option('-s, --start <startTime>', 'add start_time', addFormat)
  .option('-e, --end <endTime>', 'add end_time', addFormat)
  .parse(process.argv)
  .action((t) => {
    console.log('child1 action call');
  });
// 选项则使用.opts()来获取选项值
const options = program.opts();
console.log(options);

// const addFormat = (value, Accumulator) => {
//   console.log(value, Accumulator);
//   return value;
// };
// program
// .description('I need to help!')
// .option('-a,--add <arg1>','add something', addFormat)
// .option('-s,--sum <arg2>','sum something', addFormat)
// .parse(process.argv);
// const options = program.opts()
// console.log(options)